package cn.meizhu.order.controller;


import cn.meizhu.order.service.IOrderAdoptService;
import cn.meizhu.order.service.IOrderProductService;
import cn.meizhu.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Map;

@RestController
@RequestMapping("/orderProduct")
public class OrderProductController {

    @Autowired
    private IOrderProductService orderProductService;

    /**
     * 提交上门服务订单
     */
    @PostMapping("/submitProduct")
    public AjaxResult submitProduct(@RequestBody Map<String,String> map, HttpServletRequest request){
        try {
            return orderProductService.submitProduct(map,request);
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.me().setMessage(e.getMessage());
        }
    }
}
